<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.12"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>emp-toolkit: /Users/wangxiao/git/emp-toolkit/emp-input-validity/input-validity/elgamal.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo-full-doxygen.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">emp-toolkit
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.12 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('elgamal_8h_source.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">elgamal.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="elgamal_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#ifndef ELGAMAL_H__</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#define ELGAMAL_H__</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="emp-tool_8h.html">emp-tool/emp-tool.h</a>&gt;</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;</div><div class="line"><a name="l00005"></a><span class="lineno"><a class="line" href="class_elgamal.html">    5</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_elgamal.html">Elgamal</a>{ <span class="keyword">public</span>:</div><div class="line"><a name="l00006"></a><span class="lineno"><a class="line" href="class_elgamal.html#aacb982ec83335859aaba1083b27a5d39">    6</a></span>&#160;    <a class="code" href="class_net_i_o.html">NetIO</a> * <a class="code" href="class_elgamal.html#aacb982ec83335859aaba1083b27a5d39">io</a>;</div><div class="line"><a name="l00007"></a><span class="lineno"><a class="line" href="class_elgamal.html#a9cd0d1545b1b46f572819d3c76ca5543">    7</a></span>&#160;    eb_t <a class="code" href="class_elgamal.html#a0a869177e41b7d6fbf8af2563cdcce37">g</a>, <a class="code" href="class_elgamal.html#a9cd0d1545b1b46f572819d3c76ca5543">h</a>;</div><div class="line"><a name="l00008"></a><span class="lineno"><a class="line" href="class_elgamal.html#a54c6642d667c870549c4c86be26488cf">    8</a></span>&#160;    eb_t <a class="code" href="class_elgamal.html#a54c6642d667c870549c4c86be26488cf">hTbl</a>[RELIC_EB_TABLE_MAX];</div><div class="line"><a name="l00009"></a><span class="lineno"><a class="line" href="class_elgamal.html#a0cd3c8af11badf57b86f8c21614dcd4c">    9</a></span>&#160;    <span class="keyword">const</span> eb_t * <a class="code" href="class_elgamal.html#a0cd3c8af11badf57b86f8c21614dcd4c">gTbl</a>;</div><div class="line"><a name="l00010"></a><span class="lineno"><a class="line" href="class_elgamal.html#aebfda62a019361329a552c1be8810a24">   10</a></span>&#160;    bn_t <a class="code" href="class_elgamal.html#aebfda62a019361329a552c1be8810a24">w</a>, <a class="code" href="class_elgamal.html#aeb6046d3bbe412baa226e6d8ade91b14">q</a>;</div><div class="line"><a name="l00011"></a><span class="lineno"><a class="line" href="class_elgamal.html#a2dd1b6916d3a82e0715bf246c6d67951">   11</a></span>&#160;    <span class="keywordtype">int</span> <a class="code" href="class_elgamal.html#a2dd1b6916d3a82e0715bf246c6d67951">party</a>;</div><div class="line"><a name="l00012"></a><span class="lineno"><a class="line" href="class_elgamal.html#a19db18c8fc63916bdd8674f58f4d3261">   12</a></span>&#160;    <a class="code" href="class_p_r_g.html">PRG</a> <a class="code" href="class_elgamal.html#a19db18c8fc63916bdd8674f58f4d3261">prg</a>;</div><div class="line"><a name="l00013"></a><span class="lineno"><a class="line" href="class_elgamal.html#aa9ad303c463591e19d5f9c49c9902d73">   13</a></span>&#160;    <span class="keywordtype">int</span> <a class="code" href="class_elgamal.html#aa9ad303c463591e19d5f9c49c9902d73">length</a>;</div><div class="line"><a name="l00014"></a><span class="lineno"><a class="line" href="class_elgamal.html#a431bd17af11c5f20f5ecb5c9f62d6cd8">   14</a></span>&#160;    <a class="code" href="class_elgamal.html#a431bd17af11c5f20f5ecb5c9f62d6cd8">Elgamal</a>(<a class="code" href="class_net_i_o.html">NetIO</a> * io, <span class="keywordtype">int</span> party, <span class="keywordtype">int</span> length) </div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;        : io(io), party(party) , length(length) {</div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;        <a class="code" href="utils__ec_8h.html#a782fdb3f06e7f49116d014d4a583b19f">initialize_relic</a>();</div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;        eb_newl(g, h);</div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;        bn_newl(w, q);</div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;        eb_curve_get_ord(q);</div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;        eb_curve_get_gen(g);</div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;        gTbl = eb_curve_get_tab();</div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;        assert(<a class="code" href="class_elgamal.html#a764d872d10a6da09155bc9f572764cef">setup_omega</a>());</div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;        eb_mul_pre(hTbl, h);</div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;    }</div><div class="line"><a name="l00025"></a><span class="lineno"><a class="line" href="class_elgamal.html#a764d872d10a6da09155bc9f572764cef">   25</a></span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="class_elgamal.html#a764d872d10a6da09155bc9f572764cef">setup_omega</a>() {</div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;        <span class="keywordflow">if</span>(party == <a class="code" href="utils_8h.html#a856092a6a37aac1b54145ea9e3e03364">ALICE</a>) {</div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;            bn_t <a class="code" href="class_elgamal.html#aef94c47eefd90e9db3f3f04b8286746e">r</a>, c;</div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;            bn_newl(r, c, w);</div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;            prg.<a class="code" href="class_p_r_g.html#ab8560a2768e2ed1d9ce3cdc26a3b793d">random_bn</a>(r, w);</div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;            eb_t t; </div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;            eb_newl(t);</div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;            eb_mul_fix_norm(h, gTbl, w);</div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;            eb_mul_fix_norm(t, gTbl, r);</div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;            io-&gt;<a class="code" href="class_i_o_channel.html#aad8d725dd71ade3a6e846349beb16d43">send_eb</a>(&amp;h, 1);</div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;            io-&gt;<a class="code" href="class_i_o_channel.html#aad8d725dd71ade3a6e846349beb16d43">send_eb</a>(&amp;t, 1);</div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;            io-&gt;<a class="code" href="class_i_o_channel.html#aee3630f3b3f4fcc602ade811434660cc">recv_bn</a>(&amp;c, 1);</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;            bn_mul_mod(c, c, w, q);</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;            bn_add_mod(c, c, r, q);</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;            io-&gt;<a class="code" href="class_i_o_channel.html#a6772f720a933d14fcaa1f23de41c8aaa">send_bn</a>(&amp;c, 1);</div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;            <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;        } <span class="keywordflow">else</span> {<span class="comment">//BOB</span></div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;            eb_t t, hc, gs; </div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;            bn_t c, s;</div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;            eb_newl(t, hc, gs);</div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;            bn_newl(c, s);</div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;            prg.<a class="code" href="class_p_r_g.html#ab8560a2768e2ed1d9ce3cdc26a3b793d">random_bn</a>(c);</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;            io-&gt;<a class="code" href="class_i_o_channel.html#aa028f3ebb09c2cfa9c58be21ef81c271">recv_eb</a>(&amp;h, 1);</div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;            io-&gt;<a class="code" href="class_i_o_channel.html#aa028f3ebb09c2cfa9c58be21ef81c271">recv_eb</a>(&amp;t, 1);</div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;            io-&gt;<a class="code" href="class_i_o_channel.html#a6772f720a933d14fcaa1f23de41c8aaa">send_bn</a>(&amp;c, 1);</div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;            io-&gt;<a class="code" href="class_i_o_channel.html#aee3630f3b3f4fcc602ade811434660cc">recv_bn</a>(&amp;s, 1);</div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;            eb_mul_norm(hc, h, c);</div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;            eb_mul_fix_norm(gs, gTbl, s);</div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;            eb_add_norm(hc, hc, t);</div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;            <span class="keywordflow">return</span> (eb_cmp(hc, gs)==CMP_EQ);    </div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;        }</div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;    }</div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;</div><div class="line"><a name="l00058"></a><span class="lineno"><a class="line" href="class_elgamal.html#a9dbc7d449a0efce1cfee1f29e725c600">   58</a></span>&#160;    <a class="code" href="class_elgamal.html#a9dbc7d449a0efce1cfee1f29e725c600">~Elgamal</a>(){</div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;        <span class="keywordflow">if</span>(<a class="code" href="class_elgamal.html#aef94c47eefd90e9db3f3f04b8286746e">r</a>!= <span class="keyword">nullptr</span>)</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;            <span class="keyword">delete</span>[] <a class="code" href="class_elgamal.html#aef94c47eefd90e9db3f3f04b8286746e">r</a>;</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;        <span class="keywordflow">if</span>(<a class="code" href="class_elgamal.html#ab717d9525fad5273a6da9b90b6ece97a">com</a>!=<span class="keyword">nullptr</span>)<span class="keyword">delete</span>[] <a class="code" href="class_elgamal.html#ab717d9525fad5273a6da9b90b6ece97a">com</a>;</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;    }</div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;</div><div class="line"><a name="l00064"></a><span class="lineno"><a class="line" href="class_elgamal.html#a46de1e0f3a77d4fdad6ce61a33ceb908">   64</a></span>&#160;    <a class="code" href="utils__ec_8h.html#afcde481e82d4efeed62b66b9f12ccbd9">eb_tpl</a> *<a class="code" href="class_elgamal.html#ab717d9525fad5273a6da9b90b6ece97a">com</a> = <span class="keyword">nullptr</span>, *<a class="code" href="class_elgamal.html#a5e8cabc1f1bbd6fb2328f80964d599de">nA</a> = <span class="keyword">nullptr</span>, *<a class="code" href="class_elgamal.html#a46de1e0f3a77d4fdad6ce61a33ceb908">nB</a> = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l00065"></a><span class="lineno"><a class="line" href="class_elgamal.html#a8b6e7e86d9d72f306bfb5581ed0cb102">   65</a></span>&#160;    <a class="code" href="utils__ec_8h.html#a09cbcd1b9548176fce4883fa31bbd17f">bn_tpl</a> *<a class="code" href="class_elgamal.html#acd3af6c1ef54532a534329fa60aff7cb">elgl_s</a> = <span class="keyword">nullptr</span>, *<a class="code" href="class_elgamal.html#a8b6e7e86d9d72f306bfb5581ed0cb102">elgl_t</a> = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l00066"></a><span class="lineno"><a class="line" href="class_elgamal.html#aef94c47eefd90e9db3f3f04b8286746e">   66</a></span>&#160;    bn_t * <a class="code" href="class_elgamal.html#aef94c47eefd90e9db3f3f04b8286746e">r</a> = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l00067"></a><span class="lineno"><a class="line" href="class_elgamal.html#a3baff0f244c800c28c0d41205020f856">   67</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="class_elgamal.html#a3baff0f244c800c28c0d41205020f856">commit</a>(bn_t r, <a class="code" href="utils__ec_8h.html#afcde481e82d4efeed62b66b9f12ccbd9">eb_tpl</a> com, <span class="keywordtype">bool</span> b, <a class="code" href="class_p_r_g.html">PRG</a> * prg) {</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;        prg-&gt;<a class="code" href="class_p_r_g.html#ab8560a2768e2ed1d9ce3cdc26a3b793d">random_bn</a>(r);</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;        eb_mul_fix_norm(com[0], gTbl, r);</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;        eb_mul_fix_norm(com[1], hTbl, r);</div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;        <span class="keywordflow">if</span>(b) eb_add_norm(com[1], com[1], g);</div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;    }</div><div class="line"><a name="l00073"></a><span class="lineno"><a class="line" href="class_elgamal.html#a15681113671852465381606f5b9c225e">   73</a></span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="class_elgamal.html#a15681113671852465381606f5b9c225e">check_eq</a>(<a class="code" href="utils__ec_8h.html#afcde481e82d4efeed62b66b9f12ccbd9">eb_tpl</a> new_com, <a class="code" href="utils__ec_8h.html#afcde481e82d4efeed62b66b9f12ccbd9">eb_tpl</a> old_com, bn_t r_diff) {</div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;        eb_t tmp;</div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;        eb_mul_fix_norm(tmp, gTbl, r_diff);</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;        eb_add_norm(tmp, new_com[0], tmp);</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;        <span class="keywordflow">if</span>(eb_cmp(tmp, old_com[0])!=CMP_EQ)</div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;            <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;        eb_mul_fix_norm(tmp, hTbl, r_diff);</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;        eb_add_norm(tmp, new_com[1], tmp);</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;        <span class="keywordflow">if</span>(eb_cmp(tmp, old_com[1])!=CMP_EQ)</div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;            <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">true</span>;    </div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;    }   </div><div class="line"><a name="l00086"></a><span class="lineno"><a class="line" href="class_elgamal.html#aa1ce2f679f95775c8911106f9010d16d">   86</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="class_elgamal.html#aa1ce2f679f95775c8911106f9010d16d">send</a>(<a class="code" href="utils__ec_8h.html#afcde481e82d4efeed62b66b9f12ccbd9">eb_tpl</a>* X) {</div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;        <a class="code" href="class_elgamal.html#a5e8cabc1f1bbd6fb2328f80964d599de">nA</a> = <span class="keyword">new</span> <a class="code" href="utils__ec_8h.html#afcde481e82d4efeed62b66b9f12ccbd9">eb_tpl</a>[<a class="code" href="class_elgamal.html#aa9ad303c463591e19d5f9c49c9902d73">length</a>];</div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;        <a class="code" href="class_elgamal.html#a46de1e0f3a77d4fdad6ce61a33ceb908">nB</a> = <span class="keyword">new</span> <a class="code" href="utils__ec_8h.html#afcde481e82d4efeed62b66b9f12ccbd9">eb_tpl</a>[<a class="code" href="class_elgamal.html#aa9ad303c463591e19d5f9c49c9902d73">length</a>];</div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;        eb_t tmp; eb_newl(tmp);</div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;        com = <span class="keyword">new</span> <a class="code" href="utils__ec_8h.html#afcde481e82d4efeed62b66b9f12ccbd9">eb_tpl</a>[<a class="code" href="class_elgamal.html#aa9ad303c463591e19d5f9c49c9902d73">length</a>];</div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;        elgl_s = <span class="keyword">new</span> <a class="code" href="utils__ec_8h.html#a09cbcd1b9548176fce4883fa31bbd17f">bn_tpl</a>[<a class="code" href="class_elgamal.html#aa9ad303c463591e19d5f9c49c9902d73">length</a>];</div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;        <a class="code" href="class_elgamal.html#a8b6e7e86d9d72f306bfb5581ed0cb102">elgl_t</a> = <span class="keyword">new</span> <a class="code" href="utils__ec_8h.html#a09cbcd1b9548176fce4883fa31bbd17f">bn_tpl</a>[<a class="code" href="class_elgamal.html#aa9ad303c463591e19d5f9c49c9902d73">length</a>];</div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;        <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i = 0; i &lt; <a class="code" href="class_elgamal.html#aa9ad303c463591e19d5f9c49c9902d73">length</a>; ++i) {</div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;            prg.<a class="code" href="class_p_r_g.html#ab8560a2768e2ed1d9ce3cdc26a3b793d">random_bn</a>(elgl_s[i][0], elgl_s[i][1], <a class="code" href="class_elgamal.html#a8b6e7e86d9d72f306bfb5581ed0cb102">elgl_t</a>[i][0], <a class="code" href="class_elgamal.html#a8b6e7e86d9d72f306bfb5581ed0cb102">elgl_t</a>[i][1]);</div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;            eb_mul_fix_norm(<a class="code" href="class_elgamal.html#a5e8cabc1f1bbd6fb2328f80964d599de">nA</a>[i][0], gTbl, elgl_s[i][0]);<span class="comment">//A0=g^s0</span></div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;            eb_mul_fix_norm(tmp, hTbl, <a class="code" href="class_elgamal.html#a8b6e7e86d9d72f306bfb5581ed0cb102">elgl_t</a>[i][0]);</div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;            eb_add_norm(<a class="code" href="class_elgamal.html#a5e8cabc1f1bbd6fb2328f80964d599de">nA</a>[i][0], <a class="code" href="class_elgamal.html#a5e8cabc1f1bbd6fb2328f80964d599de">nA</a>[i][0], tmp);<span class="comment">//A0 = g^s0h^t0</span></div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;</div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;            eb_mul_fix_norm(<a class="code" href="class_elgamal.html#a5e8cabc1f1bbd6fb2328f80964d599de">nA</a>[i][1], gTbl, elgl_s[i][1]);<span class="comment">//A1=g^s1</span></div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;            eb_mul_fix_norm(tmp, hTbl, <a class="code" href="class_elgamal.html#a8b6e7e86d9d72f306bfb5581ed0cb102">elgl_t</a>[i][1]);</div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;            eb_add_norm(<a class="code" href="class_elgamal.html#a5e8cabc1f1bbd6fb2328f80964d599de">nA</a>[i][1], <a class="code" href="class_elgamal.html#a5e8cabc1f1bbd6fb2328f80964d599de">nA</a>[i][1], tmp);<span class="comment">//A1 = g^s1h^t1</span></div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;</div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;            io-&gt;<a class="code" href="class_i_o_channel.html#aa028f3ebb09c2cfa9c58be21ef81c271">recv_eb</a>(com[i], 2);</div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;            eb_mul_norm(<a class="code" href="class_elgamal.html#a46de1e0f3a77d4fdad6ce61a33ceb908">nB</a>[i][0], com[i][0], elgl_s[i][0]);</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;            eb_mul_norm(tmp, com[i][1], <a class="code" href="class_elgamal.html#a8b6e7e86d9d72f306bfb5581ed0cb102">elgl_t</a>[i][0]);</div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;            eb_add_norm(<a class="code" href="class_elgamal.html#a46de1e0f3a77d4fdad6ce61a33ceb908">nB</a>[i][0], <a class="code" href="class_elgamal.html#a46de1e0f3a77d4fdad6ce61a33ceb908">nB</a>[i][0], tmp);</div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;            eb_add_norm(<a class="code" href="class_elgamal.html#a46de1e0f3a77d4fdad6ce61a33ceb908">nB</a>[i][0], <a class="code" href="class_elgamal.html#a46de1e0f3a77d4fdad6ce61a33ceb908">nB</a>[i][0], X[i][0]);</div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;            eb_mul_norm(<a class="code" href="class_elgamal.html#a46de1e0f3a77d4fdad6ce61a33ceb908">nB</a>[i][1], com[i][0], elgl_s[i][1]);</div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;            eb_sub_norm(tmp, com[i][1], g);</div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;            eb_mul_norm(tmp, tmp, <a class="code" href="class_elgamal.html#a8b6e7e86d9d72f306bfb5581ed0cb102">elgl_t</a>[i][1]);</div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;            eb_add_norm(<a class="code" href="class_elgamal.html#a46de1e0f3a77d4fdad6ce61a33ceb908">nB</a>[i][1], <a class="code" href="class_elgamal.html#a46de1e0f3a77d4fdad6ce61a33ceb908">nB</a>[i][1], tmp);</div><div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;            eb_add_norm(<a class="code" href="class_elgamal.html#a46de1e0f3a77d4fdad6ce61a33ceb908">nB</a>[i][1], <a class="code" href="class_elgamal.html#a46de1e0f3a77d4fdad6ce61a33ceb908">nB</a>[i][1], X[i][1]);</div><div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;        }</div><div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;</div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;        <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i = 0; i &lt; <a class="code" href="class_elgamal.html#aa9ad303c463591e19d5f9c49c9902d73">length</a>; ++i) {</div><div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;            io-&gt;<a class="code" href="class_i_o_channel.html#aad8d725dd71ade3a6e846349beb16d43">send_eb</a>(<a class="code" href="class_elgamal.html#a5e8cabc1f1bbd6fb2328f80964d599de">nA</a>[i], 2);</div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;            io-&gt;<a class="code" href="class_i_o_channel.html#aad8d725dd71ade3a6e846349beb16d43">send_eb</a>(<a class="code" href="class_elgamal.html#a46de1e0f3a77d4fdad6ce61a33ceb908">nB</a>[i], 2);</div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;        }</div><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;        <span class="keyword">delete</span>[] <a class="code" href="class_elgamal.html#a5e8cabc1f1bbd6fb2328f80964d599de">nA</a>;</div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;        <span class="keyword">delete</span>[] <a class="code" href="class_elgamal.html#a46de1e0f3a77d4fdad6ce61a33ceb908">nB</a>;</div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;    }</div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;</div><div class="line"><a name="l00124"></a><span class="lineno"><a class="line" href="class_elgamal.html#aa5d602af75afbd1f1e0ff8df3698a73d">  124</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="class_elgamal.html#aa5d602af75afbd1f1e0ff8df3698a73d">open</a>( ) {</div><div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;        <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i = 0; i &lt; <a class="code" href="class_elgamal.html#aa9ad303c463591e19d5f9c49c9902d73">length</a>; ++i) {</div><div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;            io-&gt;<a class="code" href="class_i_o_channel.html#a6772f720a933d14fcaa1f23de41c8aaa">send_bn</a>(elgl_s[i], 2);</div><div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;            io-&gt;<a class="code" href="class_i_o_channel.html#a6772f720a933d14fcaa1f23de41c8aaa">send_bn</a>(<a class="code" href="class_elgamal.html#a8b6e7e86d9d72f306bfb5581ed0cb102">elgl_t</a>[i], 2);</div><div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;        }</div><div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;        <span class="keyword">delete</span>[] <a class="code" href="class_elgamal.html#acd3af6c1ef54532a534329fa60aff7cb">elgl_s</a>;</div><div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;        <span class="keyword">delete</span>[] <a class="code" href="class_elgamal.html#a8b6e7e86d9d72f306bfb5581ed0cb102">elgl_t</a>;</div><div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;    }</div><div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;</div><div class="line"><a name="l00133"></a><span class="lineno"><a class="line" href="class_elgamal.html#aa329d14d0e48d457dae7032774774bc5">  133</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="class_elgamal.html#aa329d14d0e48d457dae7032774774bc5">recv</a>(eb_t* X, <span class="keywordtype">bool</span> * b) {</div><div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;        <a class="code" href="class_elgamal.html#a5e8cabc1f1bbd6fb2328f80964d599de">nA</a> = <span class="keyword">new</span> <a class="code" href="utils__ec_8h.html#afcde481e82d4efeed62b66b9f12ccbd9">eb_tpl</a>[<a class="code" href="class_elgamal.html#aa9ad303c463591e19d5f9c49c9902d73">length</a>];</div><div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;        <a class="code" href="class_elgamal.html#a46de1e0f3a77d4fdad6ce61a33ceb908">nB</a> = <span class="keyword">new</span> <a class="code" href="utils__ec_8h.html#afcde481e82d4efeed62b66b9f12ccbd9">eb_tpl</a>[<a class="code" href="class_elgamal.html#aa9ad303c463591e19d5f9c49c9902d73">length</a>];</div><div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;        r = <span class="keyword">new</span> bn_t[<a class="code" href="class_elgamal.html#aa9ad303c463591e19d5f9c49c9902d73">length</a>];</div><div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;        <a class="code" href="utils__ec_8h.html#afcde481e82d4efeed62b66b9f12ccbd9">eb_tpl</a> <a class="code" href="class_elgamal.html#ab717d9525fad5273a6da9b90b6ece97a">com</a>;</div><div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;        <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i = 0; i &lt; <a class="code" href="class_elgamal.html#aa9ad303c463591e19d5f9c49c9902d73">length</a>; ++i) {</div><div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;            <a class="code" href="class_elgamal.html#a3baff0f244c800c28c0d41205020f856">commit</a>(r[i], com, b[i], &amp;prg);</div><div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;            io-&gt;<a class="code" href="class_i_o_channel.html#aad8d725dd71ade3a6e846349beb16d43">send_eb</a>(com, 2);</div><div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;        }</div><div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;</div><div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;        <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i = 0; i &lt; <a class="code" href="class_elgamal.html#aa9ad303c463591e19d5f9c49c9902d73">length</a>; ++i) {</div><div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;            io-&gt;<a class="code" href="class_i_o_channel.html#aa028f3ebb09c2cfa9c58be21ef81c271">recv_eb</a>(<a class="code" href="class_elgamal.html#a5e8cabc1f1bbd6fb2328f80964d599de">nA</a>[i], 2);</div><div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;            io-&gt;<a class="code" href="class_i_o_channel.html#aa028f3ebb09c2cfa9c58be21ef81c271">recv_eb</a>(<a class="code" href="class_elgamal.html#a46de1e0f3a77d4fdad6ce61a33ceb908">nB</a>[i], 2);</div><div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;            <span class="keywordtype">int</span> ind = b[i]? 1: 0;</div><div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;            eb_mul_norm(X[i], <a class="code" href="class_elgamal.html#a5e8cabc1f1bbd6fb2328f80964d599de">nA</a>[i][ind], r[i]);</div><div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;            eb_sub_norm(X[i], <a class="code" href="class_elgamal.html#a46de1e0f3a77d4fdad6ce61a33ceb908">nB</a>[i][ind], X[i]);</div><div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;        }</div><div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;    }</div><div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;</div><div class="line"><a name="l00152"></a><span class="lineno"><a class="line" href="class_elgamal.html#a6cab624dc215c22a34b52729b2d88e3b">  152</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="class_elgamal.html#a6cab624dc215c22a34b52729b2d88e3b">open</a>(<a class="code" href="utils__ec_8h.html#afcde481e82d4efeed62b66b9f12ccbd9">eb_tpl</a>* Xs, <span class="keywordtype">bool</span> * b, eb_t * X) {</div><div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;        <a class="code" href="utils__ec_8h.html#a09cbcd1b9548176fce4883fa31bbd17f">bn_tpl</a> s, t;</div><div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;        eb_t Ar, gt;</div><div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;        <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i = 0; i &lt; <a class="code" href="class_elgamal.html#aa9ad303c463591e19d5f9c49c9902d73">length</a>; ++i) {</div><div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;            io-&gt;<a class="code" href="class_i_o_channel.html#aee3630f3b3f4fcc602ade811434660cc">recv_bn</a>(s, 2);</div><div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;            io-&gt;<a class="code" href="class_i_o_channel.html#aee3630f3b3f4fcc602ade811434660cc">recv_bn</a>(t, 2);</div><div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;            <span class="keywordtype">int</span> ind = b[i]? 1:0;</div><div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;            eb_copy(Xs[i][ind], X[i]);</div><div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;            eb_mul_norm(Ar, <a class="code" href="class_elgamal.html#a5e8cabc1f1bbd6fb2328f80964d599de">nA</a>[i][1-ind], r[i]);</div><div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;            eb_sub_norm(Ar, <a class="code" href="class_elgamal.html#a46de1e0f3a77d4fdad6ce61a33ceb908">nB</a>[i][1-ind], Ar);</div><div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;            eb_mul_fix_norm(gt, gTbl, t[1-ind]);</div><div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;            <span class="keywordflow">if</span>(ind == 1) {</div><div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;                eb_sub_norm(Xs[i][1-ind], Ar, gt);</div><div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;            } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;                eb_add_norm(Xs[i][1-ind], Ar, gt);</div><div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;            }</div><div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;        }</div><div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;        <span class="keyword">delete</span>[] <a class="code" href="class_elgamal.html#a5e8cabc1f1bbd6fb2328f80964d599de">nA</a>;</div><div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;        <span class="keyword">delete</span>[] <a class="code" href="class_elgamal.html#a46de1e0f3a77d4fdad6ce61a33ceb908">nB</a>;</div><div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;    }</div><div class="line"><a name="l00172"></a><span class="lineno"><a class="line" href="class_elgamal.html#ab31d3c6a27b2ee06ddad7d6a6679f66d">  172</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="class_elgamal.html#ab31d3c6a27b2ee06ddad7d6a6679f66d">recovery</a>(<span class="keywordtype">bool</span>* b, bn_t omega) {</div><div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;        <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i = 0; i &lt; <a class="code" href="class_elgamal.html#aa9ad303c463591e19d5f9c49c9902d73">length</a>; ++i) {</div><div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;            eb_mul_norm(com[i][0], com[i][0], omega);</div><div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;            b[i] = (eb_cmp(com[i][0], com[i][1]) != CMP_EQ);</div><div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;        }</div><div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;    }</div><div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;}; </div><div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;<span class="preprocessor">#endif// PKFC_H__</span></div><div class="ttc" id="class_elgamal_html_a54c6642d667c870549c4c86be26488cf"><div class="ttname"><a href="class_elgamal.html#a54c6642d667c870549c4c86be26488cf">Elgamal::hTbl</a></div><div class="ttdeci">eb_t hTbl[RELIC_EB_TABLE_MAX]</div><div class="ttdef"><b>Definition:</b> elgamal.h:8</div></div>
<div class="ttc" id="class_i_o_channel_html_a6772f720a933d14fcaa1f23de41c8aaa"><div class="ttname"><a href="class_i_o_channel.html#a6772f720a933d14fcaa1f23de41c8aaa">IOChannel::send_bn</a></div><div class="ttdeci">void send_bn(const bn_t *bn, size_t num)</div><div class="ttdef"><b>Definition:</b> io_channel.h:160</div></div>
<div class="ttc" id="class_elgamal_html_a2dd1b6916d3a82e0715bf246c6d67951"><div class="ttname"><a href="class_elgamal.html#a2dd1b6916d3a82e0715bf246c6d67951">Elgamal::party</a></div><div class="ttdeci">int party</div><div class="ttdef"><b>Definition:</b> elgamal.h:11</div></div>
<div class="ttc" id="class_elgamal_html_ab31d3c6a27b2ee06ddad7d6a6679f66d"><div class="ttname"><a href="class_elgamal.html#ab31d3c6a27b2ee06ddad7d6a6679f66d">Elgamal::recovery</a></div><div class="ttdeci">void recovery(bool *b, bn_t omega)</div><div class="ttdef"><b>Definition:</b> elgamal.h:172</div></div>
<div class="ttc" id="class_elgamal_html_a46de1e0f3a77d4fdad6ce61a33ceb908"><div class="ttname"><a href="class_elgamal.html#a46de1e0f3a77d4fdad6ce61a33ceb908">Elgamal::nB</a></div><div class="ttdeci">eb_tpl * nB</div><div class="ttdef"><b>Definition:</b> elgamal.h:64</div></div>
<div class="ttc" id="class_elgamal_html_aa1ce2f679f95775c8911106f9010d16d"><div class="ttname"><a href="class_elgamal.html#aa1ce2f679f95775c8911106f9010d16d">Elgamal::send</a></div><div class="ttdeci">void send(eb_tpl *X)</div><div class="ttdef"><b>Definition:</b> elgamal.h:86</div></div>
<div class="ttc" id="class_net_i_o_html"><div class="ttname"><a href="class_net_i_o.html">NetIO</a></div><div class="ttdef"><b>Definition:</b> net_io_channel.h:22</div></div>
<div class="ttc" id="class_elgamal_html_aebfda62a019361329a552c1be8810a24"><div class="ttname"><a href="class_elgamal.html#aebfda62a019361329a552c1be8810a24">Elgamal::w</a></div><div class="ttdeci">bn_t w</div><div class="ttdef"><b>Definition:</b> elgamal.h:10</div></div>
<div class="ttc" id="class_elgamal_html_acd3af6c1ef54532a534329fa60aff7cb"><div class="ttname"><a href="class_elgamal.html#acd3af6c1ef54532a534329fa60aff7cb">Elgamal::elgl_s</a></div><div class="ttdeci">bn_tpl * elgl_s</div><div class="ttdef"><b>Definition:</b> elgamal.h:65</div></div>
<div class="ttc" id="class_i_o_channel_html_aa028f3ebb09c2cfa9c58be21ef81c271"><div class="ttname"><a href="class_i_o_channel.html#aa028f3ebb09c2cfa9c58be21ef81c271">IOChannel::recv_eb</a></div><div class="ttdeci">void recv_eb(eb_t *eb, size_t num)</div><div class="ttdef"><b>Definition:</b> io_channel.h:150</div></div>
<div class="ttc" id="utils__ec_8h_html_afcde481e82d4efeed62b66b9f12ccbd9"><div class="ttname"><a href="utils__ec_8h.html#afcde481e82d4efeed62b66b9f12ccbd9">eb_tpl</a></div><div class="ttdeci">eb_t eb_tpl[2]</div><div class="ttdef"><b>Definition:</b> utils_ec.h:14</div></div>
<div class="ttc" id="class_elgamal_html_a15681113671852465381606f5b9c225e"><div class="ttname"><a href="class_elgamal.html#a15681113671852465381606f5b9c225e">Elgamal::check_eq</a></div><div class="ttdeci">bool check_eq(eb_tpl new_com, eb_tpl old_com, bn_t r_diff)</div><div class="ttdef"><b>Definition:</b> elgamal.h:73</div></div>
<div class="ttc" id="class_elgamal_html_a431bd17af11c5f20f5ecb5c9f62d6cd8"><div class="ttname"><a href="class_elgamal.html#a431bd17af11c5f20f5ecb5c9f62d6cd8">Elgamal::Elgamal</a></div><div class="ttdeci">Elgamal(NetIO *io, int party, int length)</div><div class="ttdef"><b>Definition:</b> elgamal.h:14</div></div>
<div class="ttc" id="class_elgamal_html_aef94c47eefd90e9db3f3f04b8286746e"><div class="ttname"><a href="class_elgamal.html#aef94c47eefd90e9db3f3f04b8286746e">Elgamal::r</a></div><div class="ttdeci">bn_t * r</div><div class="ttdef"><b>Definition:</b> elgamal.h:66</div></div>
<div class="ttc" id="class_i_o_channel_html_aad8d725dd71ade3a6e846349beb16d43"><div class="ttname"><a href="class_i_o_channel.html#aad8d725dd71ade3a6e846349beb16d43">IOChannel::send_eb</a></div><div class="ttdeci">void send_eb(const eb_t *eb, size_t num)</div><div class="ttdef"><b>Definition:</b> io_channel.h:140</div></div>
<div class="ttc" id="class_elgamal_html_aacb982ec83335859aaba1083b27a5d39"><div class="ttname"><a href="class_elgamal.html#aacb982ec83335859aaba1083b27a5d39">Elgamal::io</a></div><div class="ttdeci">NetIO * io</div><div class="ttdef"><b>Definition:</b> elgamal.h:6</div></div>
<div class="ttc" id="class_elgamal_html_aeb6046d3bbe412baa226e6d8ade91b14"><div class="ttname"><a href="class_elgamal.html#aeb6046d3bbe412baa226e6d8ade91b14">Elgamal::q</a></div><div class="ttdeci">bn_t q</div><div class="ttdef"><b>Definition:</b> elgamal.h:10</div></div>
<div class="ttc" id="class_elgamal_html_a19db18c8fc63916bdd8674f58f4d3261"><div class="ttname"><a href="class_elgamal.html#a19db18c8fc63916bdd8674f58f4d3261">Elgamal::prg</a></div><div class="ttdeci">PRG prg</div><div class="ttdef"><b>Definition:</b> elgamal.h:12</div></div>
<div class="ttc" id="class_elgamal_html_a9dbc7d449a0efce1cfee1f29e725c600"><div class="ttname"><a href="class_elgamal.html#a9dbc7d449a0efce1cfee1f29e725c600">Elgamal::~Elgamal</a></div><div class="ttdeci">~Elgamal()</div><div class="ttdef"><b>Definition:</b> elgamal.h:58</div></div>
<div class="ttc" id="class_elgamal_html_a0cd3c8af11badf57b86f8c21614dcd4c"><div class="ttname"><a href="class_elgamal.html#a0cd3c8af11badf57b86f8c21614dcd4c">Elgamal::gTbl</a></div><div class="ttdeci">const eb_t * gTbl</div><div class="ttdef"><b>Definition:</b> elgamal.h:9</div></div>
<div class="ttc" id="class_elgamal_html_a764d872d10a6da09155bc9f572764cef"><div class="ttname"><a href="class_elgamal.html#a764d872d10a6da09155bc9f572764cef">Elgamal::setup_omega</a></div><div class="ttdeci">bool setup_omega()</div><div class="ttdef"><b>Definition:</b> elgamal.h:25</div></div>
<div class="ttc" id="utils__ec_8h_html_a09cbcd1b9548176fce4883fa31bbd17f"><div class="ttname"><a href="utils__ec_8h.html#a09cbcd1b9548176fce4883fa31bbd17f">bn_tpl</a></div><div class="ttdeci">bn_t bn_tpl[2]</div><div class="ttdef"><b>Definition:</b> utils_ec.h:15</div></div>
<div class="ttc" id="class_elgamal_html_aa9ad303c463591e19d5f9c49c9902d73"><div class="ttname"><a href="class_elgamal.html#aa9ad303c463591e19d5f9c49c9902d73">Elgamal::length</a></div><div class="ttdeci">int length</div><div class="ttdef"><b>Definition:</b> elgamal.h:13</div></div>
<div class="ttc" id="class_elgamal_html_aa329d14d0e48d457dae7032774774bc5"><div class="ttname"><a href="class_elgamal.html#aa329d14d0e48d457dae7032774774bc5">Elgamal::recv</a></div><div class="ttdeci">void recv(eb_t *X, bool *b)</div><div class="ttdef"><b>Definition:</b> elgamal.h:133</div></div>
<div class="ttc" id="class_elgamal_html_aa5d602af75afbd1f1e0ff8df3698a73d"><div class="ttname"><a href="class_elgamal.html#aa5d602af75afbd1f1e0ff8df3698a73d">Elgamal::open</a></div><div class="ttdeci">void open()</div><div class="ttdef"><b>Definition:</b> elgamal.h:124</div></div>
<div class="ttc" id="utils_8h_html_a856092a6a37aac1b54145ea9e3e03364"><div class="ttname"><a href="utils_8h.html#a856092a6a37aac1b54145ea9e3e03364">ALICE</a></div><div class="ttdeci">#define ALICE</div><div class="ttdef"><b>Definition:</b> utils.h:15</div></div>
<div class="ttc" id="class_elgamal_html_a3baff0f244c800c28c0d41205020f856"><div class="ttname"><a href="class_elgamal.html#a3baff0f244c800c28c0d41205020f856">Elgamal::commit</a></div><div class="ttdeci">void commit(bn_t r, eb_tpl com, bool b, PRG *prg)</div><div class="ttdef"><b>Definition:</b> elgamal.h:67</div></div>
<div class="ttc" id="utils__ec_8h_html_a782fdb3f06e7f49116d014d4a583b19f"><div class="ttname"><a href="utils__ec_8h.html#a782fdb3f06e7f49116d014d4a583b19f">initialize_relic</a></div><div class="ttdeci">void initialize_relic()</div><div class="ttdef"><b>Definition:</b> utils_ec.hpp:8</div></div>
<div class="ttc" id="class_p_r_g_html"><div class="ttname"><a href="class_p_r_g.html">PRG</a></div><div class="ttdef"><b>Definition:</b> prg.h:16</div></div>
<div class="ttc" id="class_p_r_g_html_ab8560a2768e2ed1d9ce3cdc26a3b793d"><div class="ttname"><a href="class_p_r_g.html#ab8560a2768e2ed1d9ce3cdc26a3b793d">PRG::random_bn</a></div><div class="ttdeci">void random_bn(T t, L... l)</div><div class="ttdef"><b>Definition:</b> prg.h:87</div></div>
<div class="ttc" id="class_elgamal_html_a5e8cabc1f1bbd6fb2328f80964d599de"><div class="ttname"><a href="class_elgamal.html#a5e8cabc1f1bbd6fb2328f80964d599de">Elgamal::nA</a></div><div class="ttdeci">eb_tpl * nA</div><div class="ttdef"><b>Definition:</b> elgamal.h:64</div></div>
<div class="ttc" id="class_i_o_channel_html_aee3630f3b3f4fcc602ade811434660cc"><div class="ttname"><a href="class_i_o_channel.html#aee3630f3b3f4fcc602ade811434660cc">IOChannel::recv_bn</a></div><div class="ttdeci">void recv_bn(bn_t *bn, size_t num)</div><div class="ttdef"><b>Definition:</b> io_channel.h:171</div></div>
<div class="ttc" id="class_elgamal_html_a8b6e7e86d9d72f306bfb5581ed0cb102"><div class="ttname"><a href="class_elgamal.html#a8b6e7e86d9d72f306bfb5581ed0cb102">Elgamal::elgl_t</a></div><div class="ttdeci">bn_tpl * elgl_t</div><div class="ttdef"><b>Definition:</b> elgamal.h:65</div></div>
<div class="ttc" id="class_elgamal_html_a9cd0d1545b1b46f572819d3c76ca5543"><div class="ttname"><a href="class_elgamal.html#a9cd0d1545b1b46f572819d3c76ca5543">Elgamal::h</a></div><div class="ttdeci">eb_t h</div><div class="ttdef"><b>Definition:</b> elgamal.h:7</div></div>
<div class="ttc" id="class_elgamal_html_ab717d9525fad5273a6da9b90b6ece97a"><div class="ttname"><a href="class_elgamal.html#ab717d9525fad5273a6da9b90b6ece97a">Elgamal::com</a></div><div class="ttdeci">eb_tpl * com</div><div class="ttdef"><b>Definition:</b> elgamal.h:64</div></div>
<div class="ttc" id="class_elgamal_html"><div class="ttname"><a href="class_elgamal.html">Elgamal</a></div><div class="ttdef"><b>Definition:</b> elgamal.h:5</div></div>
<div class="ttc" id="class_elgamal_html_a6cab624dc215c22a34b52729b2d88e3b"><div class="ttname"><a href="class_elgamal.html#a6cab624dc215c22a34b52729b2d88e3b">Elgamal::open</a></div><div class="ttdeci">void open(eb_tpl *Xs, bool *b, eb_t *X)</div><div class="ttdef"><b>Definition:</b> elgamal.h:152</div></div>
<div class="ttc" id="emp-tool_8h_html"><div class="ttname"><a href="emp-tool_8h.html">emp-tool.h</a></div></div>
<div class="ttc" id="class_elgamal_html_a0a869177e41b7d6fbf8af2563cdcce37"><div class="ttname"><a href="class_elgamal.html#a0a869177e41b7d6fbf8af2563cdcce37">Elgamal::g</a></div><div class="ttdeci">eb_t g</div><div class="ttdef"><b>Definition:</b> elgamal.h:7</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_a27d30adcb009e917fb5e1bf5d93fdaa.html">emp-input-validity</a></li><li class="navelem"><a class="el" href="dir_bc3e805260d4f4a48e3ca8a737c0cdb5.html">input-validity</a></li><li class="navelem"><a class="el" href="elgamal_8h.html">elgamal.h</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.12 </li>
  </ul>
</div>
</body>
</html>
